<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<html>
<head>
    <title>系统设置</title>
</head>
<body>
<div class="pageheader">
    <h2>系统设置</h2>
</div>
<div class="contentpanel">
    <div class="panel panel-default">
        <form:form action="${contextPath}/admin/setting/edit.htm" method="post" commandName="formDto"
                   cssClass="form-horizontal form-bordered">
            <form:hidden path="uuid"/>
            <div class="form-group">
                <label class="col-sm-3 control-label">应用名称</label>

                <div class="col-sm-6">
                    <form:input path="name" cssClass="form-control" placeholder="应用名称"/>
                    <form:errors path="name" cssClass="error text-danger"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">公告</label>

                <div class="col-sm-6">
                    <form:textarea path="notes" cssClass="form-control" placeholder="公告"/>
                    <form:errors path="notes" cssClass="error text-danger"/>
                </div>
            </div>
            <c:if test="${not empty param.debug}">
                <div class="form-group">
                    <label class="col-sm-3 control-label">微信appid</label>

                    <div class="col-sm-6">
                        <form:input path="appid" cssClass="form-control" placeholder="微信appid"/>
                        <form:errors path="appid" cssClass="error text-danger"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">微信secret</label>

                    <div class="col-sm-6">
                        <form:input path="secret" cssClass="form-control" placeholder="微信secret"/>
                        <form:errors path="secret" cssClass="error text-danger"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">微信token</label>

                    <div class="col-sm-6">
                        <form:input path="token" cssClass="form-control" placeholder="微信token"/>
                        <form:errors path="token" cssClass="error text-danger"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">accessToken</label>

                    <div class="col-sm-6">
                        <textarea class="form-control" rows="5">${formDto.accessToken}</textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">模板消息id</label>

                    <div class="col-sm-6">
                        <form:input path="templateId" cssClass="form-control" placeholder="模板消息id"/>
                        <form:errors path="templateId" cssClass="error text-danger"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">模板消息内容
                        <span class="fa fa-info-circle" data-container="body" data-toggle="popover"
                              data-placement="right"
                              data-content="<b>注入参数:</b><br/>
                            <p><b>comment</b>:评论相关</p>
                            <p><b>templateId</b>:模板id</p>
                            <p><b>openid</b>:接受者openid</p>
                            <p><b>url</b>:跳转url</p>
                            "></span>
                    </label>

                    <div class="col-sm-6">
                        <form:textarea path="templateContent" cssClass="form-control" rows="15" placeholder="模板消息内容"/>
                        <form:errors path="templateContent" cssClass="error text-danger"/>
                    </div>
                </div>
            </c:if>
            <div class="form-group">
                <label class="col-sm-3"></label>

                <div class="col-sm-6">
                    <button type="submit" class="btn btn-primary margin: auto">提交</button>
                    <a href="${contextPath}/admin/index.htm" class="btn btn-default">取消</a>
                </div>
            </div>
        </form:form>
    </div>
</div>
<script type="text/javascript">
    $(function () {
        $('[data-toggle="popover"]').popover({html: true});
    })
</script>


</body>
</html>
